package docs

import (
	"encoding/json"
	"strings"

	"github.com/astaxie/beego"
	"github.com/astaxie/beego/swagger"
)

const (
    Rootinfo string = `{"apiVersion":"1.0.0","swaggerVersion":"1.2","apis":[{"path":"/products","description":"ProductsController 商品货品\n"},{"path":"/express","description":"ExpressController 快递\n"},{"path":"/members","description":"MembersController 会员\n"},{"path":"/condis","description":"CondisController 优惠活动\n"},{"path":"/orders","description":"OrdersController 订单\n"}],"info":{"title":"HW123商城供应商开放接口","description":"HW123商城供应商开放API","contact":"kinwyb@aliyun.com","termsOfServiceUrl":"http://www.hw123.com"}}`
    Subapi string = `{"/condis":{"apiVersion":"1.0.0","swaggerVersion":"1.2","basePath":"","resourcePath":"/condis","produces":["application/json","application/xml","text/plain","text/html"],"apis":[{"path":"/catList","description":"","operations":[{"httpMethod":"POST","nickname":"商品分类信息","type":"","parameters":[{"paramType":"body","name":"p","description":"\"分页数据信息\"","dataType":"Page","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]},{"path":"/productList","description":"","operations":[{"httpMethod":"POST","nickname":"货品列表","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"body","name":"p","description":"\"数据分页信息\"","dataType":"Page","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]},{"path":"/disList","description":"","operations":[{"httpMethod":"POST","nickname":"优惠列表","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"body","name":"p","description":"\"数据分页信息\"","dataType":"Page","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]},{"path":"/conList","description":"","operations":[{"httpMethod":"POST","nickname":"条件列表","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"body","name":"p","description":"\"数据分页信息\"","dataType":"Page","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]},{"path":"/condisList","description":"","operations":[{"httpMethod":"POST","nickname":"优惠活动列表","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"body","name":"p","description":"\"数据分页信息\"","dataType":"Page","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]},{"path":"/addDis","description":"","operations":[{"httpMethod":"POST","nickname":"添加优惠","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"body","name":"dis","description":"\"优惠信息\"","dataType":"Discount","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}]}]},{"path":"/addCond","description":"","operations":[{"httpMethod":"POST","nickname":"添加条件","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"body","name":"cond","description":"\"添加信息\"","dataType":"Condition","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}]}]},{"path":"/addConDis","description":"","operations":[{"httpMethod":"POST","nickname":"添加优惠活动","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"body","name":"condis","description":"\"活动信息\"","dataType":"ConditionDiscount","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}]}]}]},"/express":{"apiVersion":"1.0.0","swaggerVersion":"1.2","basePath":"","resourcePath":"/express","produces":["application/json","application/xml","text/plain","text/html"],"apis":[{"path":"/regionInfo","description":"","operations":[{"httpMethod":"GET","nickname":"获取地区数据","type":"","responseMessages":[{"code":200,"message":"models.Region","responseModel":"Region"}]}]},{"path":"/expressCorpList","description":"","operations":[{"httpMethod":"POST","nickname":"获取快递公司列表","type":"","parameters":[{"paramType":"body","name":"page","description":"\"分页数据信息\"","dataType":"Page","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]},{"path":"/expressList","description":"","operations":[{"httpMethod":"POST","nickname":"供应商快递列表","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"body","name":"page","description":"\"分页数据信息\"","dataType":"Page","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]},{"path":"/addExpress","description":"","operations":[{"httpMethod":"POST","nickname":"增加快递信息","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"body","name":"express","description":"\"快递信息\"","dataType":"Express","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]},{"path":"/addExpressCorp","description":"","operations":[{"httpMethod":"POST","nickname":"增加快递公司","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"name","description":"\"物流公司名称\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"corpCode","description":"\"物理公式代码\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"website","description":"\"物流公司官网\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"requestURL","description":"\"快递查询网址\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"orderNum","description":"\"排序\"","dataType":"uint","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]},{"path":"/updateExpressCorp","description":"","operations":[{"httpMethod":"POST","nickname":"修改快递公司","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"corpID","description":"\"快递公司ID\"","dataType":"uint","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"name","description":"\"物流公司名称\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"corpCode","description":"\"物理公式代码\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"website","description":"\"物流公司官网\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"requestURL","description":"\"快递查询网址\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"orderNum","description":"\"排序\"","dataType":"uint","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]}],"models":{"Region":{"id":"Region","properties":{"Children":{"type":"\u0026{6730 string 0xc082605500}","description":"","format":""},"ID":{"type":"int","description":"","format":""},"Name":{"type":"string","description":"","format":""}}}}},"/members":{"apiVersion":"1.0.0","swaggerVersion":"1.2","basePath":"","resourcePath":"/members","produces":["application/json","application/xml","text/plain","text/html"],"apis":[{"path":"/simpleMemberInfo","description":"","operations":[{"httpMethod":"GET","nickname":"获取基本会员信息","type":"","parameters":[{"paramType":"query","name":"mid","description":"\"会员ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]},{"path":"/memberList","description":"","operations":[{"httpMethod":"POST","nickname":"获取会员列表","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"mType","description":"\"会员类型\"","dataType":"MemberType","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"search","description":"\"搜索关键字\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0},{"paramType":"body","name":"p","description":"\"分页数据信息\"","dataType":"Page","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]},{"path":"/productMemberList","description":"","operations":[{"httpMethod":"POST","nickname":"货品购买者会员列表","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"pid","description":"\"货品ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"body","name":"p","description":"\"分页数据信息\"","dataType":"Page","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]}]},"/orders":{"apiVersion":"1.0.0","swaggerVersion":"1.2","basePath":"","resourcePath":"/orders","produces":["application/json","application/xml","text/plain","text/html"],"apis":[{"path":"/orderList","description":"","operations":[{"httpMethod":"POST","nickname":"订单列表","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"type","description":"\"订单类型\"","dataType":"int","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0},{"paramType":"query","name":"starttime","description":"\"开始时间戳\"","dataType":"int64","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0},{"paramType":"endtime","name":"starttime","description":"\"结束时间戳\"","dataType":"int64","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0},{"paramType":"body","name":"p","description":"\"分页数据信息\"","dataType":"Page","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":200,"message":"models.Order","responseModel":"Order"}]}]},{"path":"/orderItem","description":"","operations":[{"httpMethod":"GET","nickname":"订单商品","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"oid","description":"\"订单号\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":200,"message":"models.OrderProduct","responseModel":"OrderProduct"}]}]},{"path":"/orderInfo","description":"","operations":[{"httpMethod":"GET","nickname":"订单详情","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"oid","description":"\"订单号\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":200,"message":"models.OrderInfo","responseModel":"OrderInfo"}]}]},{"path":"/productOrders","description":"","operations":[{"httpMethod":"POST","nickname":"商品订单列表","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"pid","description":"\"货品ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"body","name":"p","description":"\"分页数据信息\"","dataType":"Page","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":200,"message":"models.Order","responseModel":"Order"}]}]},{"path":"/orderCount","description":"","operations":[{"httpMethod":"GET","nickname":"订单统计","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"timeType","description":"\"时间类型[0=不限,1=年,2=月,3=日]\"","dataType":"int","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0},{"paramType":"query","name":"dataType","description":"\"订单统计类型[1=订单,2=金额]\"","dataType":"int","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0},{"paramType":"query","name":"t","description":"\"日期[yyyy-MM-dd HH:mm:ss]默认:当前时间\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]},{"path":"/orderTimeCount","description":"","operations":[{"httpMethod":"GET","nickname":"下单时间段统计","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"timeType","description":"\"时间类型[0=不限,1=年,2=月,3=日]\"","dataType":"int","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0},{"paramType":"query","name":"t","description":"\"日期[yyyy-MM-dd HH:mm:ss]默认:当前时间\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]},{"path":"/orderMemberCount","description":"","operations":[{"httpMethod":"GET","nickname":"订单会员数据统计","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"timeType","description":"\"时间类型[0=不限,1=年,2=月,3=日]\"","dataType":"int","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0},{"paramType":"query","name":"t","description":"\"日期[yyyy-MM-dd HH:mm:ss]默认:当前时间\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]},{"path":"/orderLocalCount","description":"","operations":[{"httpMethod":"GET","nickname":"订单地区统计","type":"","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"timeType","description":"\"时间类型[0=不限,1=年,2=月,3=日]\"","dataType":"int","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0},{"paramType":"query","name":"t","description":"\"日期[yyyy-MM-dd HH:mm:ss]默认:当前时间\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0}],"responseMessages":[{"code":0,"message":"200","responseModel":""}]}]}],"models":{"Order":{"id":"Order","properties":{"CreateTime":{"type":"int64","description":"","format":""},"LastModified":{"type":"int64","description":"","format":""},"LoginAccount":{"type":"string","description":"","format":""},"OrderID":{"type":"uint64","description":"","format":""},"PayStatus":{"type":"string","description":"","format":""},"ShipAddr":{"type":"string","description":"","format":""},"ShipMobile":{"type":"string","description":"","format":""},"ShipName":{"type":"string","description":"","format":""},"ShipStatue":{"type":"string","description":"","format":""},"ShipTel":{"type":"string","description":"","format":""},"TotalAmount":{"type":"float64","description":"","format":""}}},"OrderInfo":{"id":"OrderInfo","properties":{"CostFreight":{"type":"float64","description":"","format":""},"CostItem":{"type":"float64","description":"","format":""},"CostPayMent":{"type":"float64","description":"","format":""},"CostProtect":{"type":"float64","description":"","format":""},"CreateTime":{"type":"uint64","description":"","format":""},"Currency":{"type":"string","description":"","format":""},"Discount":{"type":"float64","description":"","format":""},"FinalAmount":{"type":"float64","description":"","format":""},"IsProtect":{"type":"string","description":"","format":""},"LastModified":{"type":"uint64","description":"","format":""},"MakeType":{"type":"string","description":"","format":""},"MarkText":{"type":"string","description":"","format":""},"Member":{"type":"\u0026{25873 string 0xc082347360}","description":"","format":""},"MemberID":{"type":"uint64","description":"","format":""},"Memo":{"type":"string","description":"","format":""},"OrderID":{"type":"uint64","description":"","format":""},"PayMent":{"type":"string","description":"","format":""},"PayStatus":{"type":"string","description":"","format":""},"Payed":{"type":"float64","description":"","format":""},"ScoreG":{"type":"float32","description":"","format":""},"ScoreU":{"type":"float32","description":"","format":""},"ShipAddr":{"type":"string","description":"","format":""},"ShipArea":{"type":"string","description":"","format":""},"ShipEmail":{"type":"string","description":"","format":""},"ShipMobile":{"type":"string","description":"","format":""},"ShipName":{"type":"string","description":"","format":""},"ShipStatus":{"type":"string","description":"","format":""},"ShipTel":{"type":"string","description":"","format":""},"ShipTime":{"type":"string","description":"","format":""},"ShipZip":{"type":"string","description":"","format":""},"Shipping":{"type":"string","description":"","format":""},"ShippingID":{"type":"int","description":"","format":""},"Source":{"type":"string","description":"","format":""},"Status":{"type":"string","description":"","format":""},"SupplierID":{"type":"uint64","description":"","format":""},"TaxContent":{"type":"string","description":"","format":""},"TaxType":{"type":"string","description":"","format":""},"TotalAmount":{"type":"float64","description":"","format":""},"Weight":{"type":"float32","description":"","format":""}}},"OrderProduct":{"id":"OrderProduct","properties":{"Amount":{"type":"float64","description":"","format":""},"Nums":{"type":"int","description":"","format":""},"Price":{"type":"float64","description":"","format":""},"ProductBN":{"type":"string","description":"","format":""},"ProductID":{"type":"uint64","description":"","format":""},"ProductName":{"type":"string","description":"","format":""}}}}},"/products":{"apiVersion":"1.0.0","swaggerVersion":"1.2","basePath":"","resourcePath":"/products","produces":["application/json","application/xml","text/plain","text/html"],"apis":[{"path":"/list","description":"","operations":[{"httpMethod":"POST","nickname":"ProductList","type":"","summary":"显示供应商提供的商品列表","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"search","description":"\"搜索字符串\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0},{"paramType":"query","name":"type","description":"\"商品状态\"","dataType":"int","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0},{"paramType":"body","name":"p","description":"\"数据分页信息\"","dataType":"Page","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":200,"message":"models.Product","responseModel":"Product"}]}]},{"path":"/product","description":"","operations":[{"httpMethod":"GET","nickname":"Product","type":"","summary":"商品基本信息","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"pid","description":"\"货品ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":200,"message":"models.Product","responseModel":"Product"}]}]},{"path":"/supplierSupplyProduct","description":"","operations":[{"httpMethod":"GET","nickname":"SupplierSupplyProduct","type":"","summary":"供应商供应商品","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"pid","description":"\"货品ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"price","description":"\"货品价格\"","dataType":"float64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"name","description":"\"货品自定义名称\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0},{"paramType":"query","name":"bn","description":"\"货品自定义编码\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0}],"responseMessages":[{"code":200,"message":"bool","responseModel":""}]}]},{"path":"/supplierChangeStore","description":"","operations":[{"httpMethod":"GET","nickname":"SupplierChangeStore","type":"","summary":"供应商修改库存","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"pid","description":"\"货品ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"price","description":"\"货品价格\"","dataType":"float64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"nums","description":"\"数量\"","dataType":"int32","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"desp","description":"\"备注\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0}],"responseMessages":[{"code":200,"message":"bool","responseModel":""}]}]},{"path":"/supplierMarketableChange","description":"","operations":[{"httpMethod":"GET","nickname":"SupplierMarketableChange","type":"","summary":"供应商货品上下架","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"pid","description":"\"货品ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"v","description":"\"上架\"","dataType":"bool","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0}],"responseMessages":[{"code":200,"message":"bool","responseModel":""}]}]},{"path":"/supplierUpdatePrice","description":"","operations":[{"httpMethod":"GET","nickname":"SupplierUpdatePrice","type":"","summary":"供应商更改商品价格","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"pid","description":"\"货品ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"price","description":"\"货品价格\"","dataType":"float64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"desp","description":"\"备注\"","dataType":"string","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0}],"responseMessages":[{"code":200,"message":"bool","responseModel":""}]}]},{"path":"/productSaleLocal","description":"","operations":[{"httpMethod":"GET","nickname":"ProductSaleLocal","type":"","summary":"货品销售区域统计","parameters":[{"paramType":"query","name":"sid","description":"\"供应商ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"pid","description":"\"货品ID\"","dataType":"uint64","type":"","format":"","allowMultiple":false,"required":true,"minimum":0,"maximum":0},{"paramType":"query","name":"localType","description":"\"地区标记[0=省,1=市,2=县]默认:0\"","dataType":"int","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0},{"paramType":"query","name":"regionID","description":"\"上一级地区ID,默认:0\"","dataType":"int","type":"","format":"","allowMultiple":false,"required":false,"minimum":0,"maximum":0}],"responseMessages":[{"code":200,"message":"bool","responseModel":""}]}]}],"models":{"Product":{"id":"Product","properties":{"Bn":{"type":"string","description":"","format":""},"BrandName":{"type":"string","description":"","format":""},"CatName":{"type":"string","description":"","format":""},"DefaultPrice":{"type":"float64","description":"","format":""},"Freez":{"type":"int","description":"","format":""},"ID":{"type":"int64","description":"","format":""},"Name":{"type":"string","description":"","format":""},"Price":{"type":"float64","description":"","format":""},"SpecInfo":{"type":"string","description":"","format":""},"Store":{"type":"int","description":"","format":""}}}}}}`
    BasePath string= "/v1"
)

var rootapi swagger.ResourceListing
var apilist map[string]*swagger.APIDeclaration

func init() {
	if beego.BConfig.WebConfig.EnableDocs {
		err := json.Unmarshal([]byte(Rootinfo), &rootapi)
		if err != nil {
			beego.Error(err)
		}
		err = json.Unmarshal([]byte(Subapi), &apilist)
		if err != nil {
			beego.Error(err)
		}
		beego.GlobalDocAPI["Root"] = rootapi
		for k, v := range apilist {
			for i, a := range v.APIs {
				a.Path = urlReplace(k + a.Path)
				v.APIs[i] = a
			}
			v.BasePath = BasePath
			beego.GlobalDocAPI[strings.Trim(k, "/")] = v
		}
	}
}


func urlReplace(src string) string {
	pt := strings.Split(src, "/")
	for i, p := range pt {
		if len(p) > 0 {
			if p[0] == ':' {
				pt[i] = "{" + p[1:] + "}"
			} else if p[0] == '?' && p[1] == ':' {
				pt[i] = "{" + p[2:] + "}"
			}
		}
	}
	return strings.Join(pt, "/")
}
